package com.wg.db.convert;

import cn.hutool.core.util.StrUtil;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 少爷123
 */
public class StringListConvert implements IConvert<List<String>> {
    @Override
    public List<String> parseObject(Object obj) {
        if (!(obj instanceof String)) {
            return new ArrayList<>();
        }

        String str = (String) obj;
        if (StrUtil.isEmpty(str)) {
            return new ArrayList<>();
        }

        return StrUtil.split(str, ",");
    }
}
